package com.example.everying.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.everying.model.entity.user.PointsTransaction;
import com.github.houbb.heaven.annotation.reflect.Param;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

/**
 * 积分流水Mapper接口
 */
@Mapper
public interface PointsTransactionMapper extends BaseMapper<PointsTransaction> {

    Optional<PointsTransaction> selectTodaySign(@Param("userId") String userId,@Param("today") LocalDate today);

    List<PointsTransaction> selectContinuousSignsBeforeDate(@Param("userId") String userId ,@Param("today") LocalDate today);

    List<PointsTransaction> selectByUserId(String userId);

    List<PointsTransaction> selectExpiredPoints(@Param("pointsDays") Integer pointsDays);
}